<%@page import="com.gym.model.entity.Payment"%>
<%@page import="com.gym.model.dao.DAOUser"%>
<%@page import="com.gym.model.dao.DAOCourse"%>
<%@page import="java.util.ArrayList"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>schedaTrainer</title>
<jsp:include page="/jsp/menu.jsp" />
</head>
<%
ArrayList<Payment> comboPayment = (ArrayList<Payment>) request.getSession().getAttribute("comboPayment");
DAOUser daoUser = new DAOUser();
DAOCourse daoCourse = new DAOCourse();
%>
<body><br>

<p style="font-size: 18px; color: black;font-weight: bold;">Trovati <%=comboPayment.size()%> pagamenti!</p>
	<br>
	<table>
		<tr> 
	   		<th>USER</th> 
	   		<th>COURSE</th>
	   		<th>MONTHS</th> 
	   		<th>AMOUNT</th> 
	   		<th>DATE</th> 
	   		<th>DELETE</th>
	 	</tr>
	<%if(!comboPayment.isEmpty()){%>
		<%for(Payment p : comboPayment){%>
	 		<tr > 
		   		<td><%=daoUser.select(p.getIduser()).getEmail()%></td>	   		
		   		<td><%=daoCourse.select(p.getIdcourse()).getActivity()%></td> 
		   		<td><%=p.getMonths()%></td>
		   		<td><%=p.getAmount()%></td> 
		   		<td><%=p.getPdate()%></td>
		   		<td>
		   			<a href="deletePayment.do?iduser=<%=p.getIduser()%>&idcourse=<%=p.getIdcourse()%>">
	   					<img title="elimina" src="elimina-icon.png" width="30" height="26" />
	   				</a>
	   			</td>
	 		</tr>
		<%}%>
	<%}%>
	</table>

</body>
</html>